package cn.wolfcode.p2p;

import cn.wolfcode.p2p.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@Import(ApplicationCoreConfig.class)
@PropertySource("classpath:application-mgrsite.properties")
@EnableScheduling
public class ApplicationMgrSiteConfig extends WebMvcConfigurerAdapter
{
    @Autowired
    private LoginInterceptor loginInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/**");
        System.out.println("aaa");
    }

    public static void main( String[] args ) {
        SpringApplication.run(ApplicationMgrSiteConfig.class,args);
    }
}
